/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.sd.jxta;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

/**
 *
 * @author SD
 */
public class Command {

    public enum ParametersName {

        FILE_NAME,
        APP
    };
    private String serviceName;
    private HashMap parameters;
    private int nRequestedRemoteAdvertisement;
    private boolean bLookOnLocal;

    public Command(String serviceName, int nRequestedRemoteAdvertisement, boolean bLookOnLocal) {
        this.serviceName = serviceName;

        this.nRequestedRemoteAdvertisement = nRequestedRemoteAdvertisement;
        this.bLookOnLocal = bLookOnLocal;
        parameters = new HashMap();
    }

    public boolean isBLookOnLocal() {
        return bLookOnLocal;
    }

    public int getNRequestedRemoteAdvertisement() {
        return nRequestedRemoteAdvertisement;
    }

    public HashMap getParameters() {
        return parameters;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void addParameter(String key, Object value) {
        parameters.put(key, value);
    }

    public Object getParameter(String key) {
        Iterator it = parameters.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry e = (Map.Entry) it.next();
            System.out.println(e.getKey() + " " + e.getValue());
        }
        return parameters.get(key);
    }
}
